<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // find: 找到数组中满足条件的第一个元素
        const array1 = [5, 12, 8, 130, 44]
        const found = array1.find((element) => element > 50)
        console.log(found)

        let srr = [
            {name: '小米', price: 1999},
            {name: '华为', price: 4999},
            {name: '苹果', price: 6999},
        ]
        const res = srr.find(item => item.price > 2000)
        const res1 = srr.find(item => item.name === '苹果')
        console.log(res)
        console.log(res1)
    </script>
</body>
</html>